<link rel="stylesheet" href="../demo.css?v={{random()}}">
<script>
document.registerElement("aup-switch-tab-by-search", {
    prototype: Object.create(HTMLElement.prototype, {
        createdCallback: { value: function() {
            let self = this;
            Array.prototype.slice.call(self.children).forEach(function(v) {
                let regex = new RegExp(v.getAttribute("pattern"));
                if (window.location.search.match(regex)) {                    
                    self.innerHTML = v.innerHTML;
                }
            });
        }},
    })
});
</script>  